From: Jasper St. Pierre Date: Mon, 20 May 2013 18:05:59 +0000 (-0400) Subject: messageTray: Hide notifications when the tray is summoned X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4146 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d5f95db68d566f882c4d984e03780a573425ea6c;p=gnome-shell.git messageTray: Hide notifications when the tray is summoned If the user summons the tray, it should take priority over a notification showing. https://bugzilla.gnome.org/show_bug.cgi?id=700639 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 28eef9294..fb3623e55 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -2218,8 +2218,10 @@ const MessageTray = new Lang.Class({ !(this._notification && this._notification.focused) && !this._pointerInNotification; let notificationLockedOut = !hasNotifications && this._notification; - let notificationMustClose = this._notificationRemoved || notificationLockedOut || (notificationExpired && this._userActiveWhileNotificationShown) || this._notificationClosed; - let canShowNotification = notificationsPending && this._trayState == State.HIDDEN; + let notificationMustClose = (this._notificationRemoved || notificationLockedOut || + (notificationExpired && this._userActiveWhileNotificationShown) || + this._notificationClosed || this._traySummoned); + let canShowNotification = notificationsPending && this._trayState == State.HIDDEN && !this._traySummoned; if (this._notificationState == State.HIDDEN) { if (canShowNotification) @@ -2233,8 +2235,6 @@ const MessageTray = new Lang.Class({ this._ensureNotificationFocused(); } - let mustHideTray = this._notificationState != State.HIDDEN || !hasNotifications; - // Summary notification let haveClickedSummaryItem = this._clickedSummaryItem != null; let summarySourceIsMainNotificationSource = (haveClickedSummaryItem && this._notification && @@ -2264,7 +2264,7 @@ const MessageTray = new Lang.Class({ // Tray itself let trayIsVisible = (this._trayState == State.SHOWING || this._trayState == State.SHOWN); - let trayShouldBeVisible = this._traySummoned && !this._keyboardVisible && !mustHideTray; + let trayShouldBeVisible = this._traySummoned && !this._keyboardVisible && hasNotifications; if (!trayIsVisible && trayShouldBeVisible) trayShouldBeVisible = this._showTray(); else if (trayIsVisible && !trayShouldBeVisible)